package cn.itsource.ymcc.client.fallback;

import cn.itsource.ymcc.client.OrderFeignClient;
import cn.itsource.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class OrderFeignClientFactory implements FallbackFactory<OrderFeignClient> {
    @Override
    public OrderFeignClient create(Throwable throwable) {
        return new OrderFeignClient(){


            @Override
            public JSONResult selectByOrderNo(String orderNo) {
                return JSONResult.error("订单获取失败");
            }
        };
    }
}
